/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package TableModel;

import Entities.Sewa;
import java.util.ArrayList;
import java.util.List;
import javax.swing.table.AbstractTableModel;

/**
 *
 * @author Tea-Nose
 */
public class Persewaan_TableModel extends AbstractTableModel{

    private List<Sewa> sewas = new ArrayList<Sewa>();

    public int getRowCount() {
        return sewas.size();
        //throw new UnsupportedOperationException("Not supported yet.");
    }

    public int getColumnCount() {
        return 9;
        //throw new UnsupportedOperationException("Not supported yet.");
    }

    public Object getValueAt(int rowIndex, int columnIndex) {
         Sewa sewa = sewas.get(rowIndex);
        switch (columnIndex) {
            case 0:
                return sewa.getNo_faktur();
            case 1:
                return sewa.getNama_penyewa();
            case 2:
                return sewa.getAlamat_penyewa();
            case 3:
                return sewa.getNo_telp_penyewa();
            case 4:
                return sewa.getTanggal_sewa();
            case 5:
                return sewa.getUang_sewa();
            case 6:
                return sewa.getTanggal_kembali();
            case 7:
                return  sewa.getDenda();
            case 8:
                return sewa.getNo_Polisi();

            default:
                return "";
        }
        //throw new UnsupportedOperationException("Not supported yet.");
    }

}
